VimUnDoZ x5_g* + class ChatApp extends HTMLElement {5_  g*  constructor() {5_ g*  super();5_ g* 4 this.attachShadow({ mode: 'open' });5_ g*  this.render();5_ g* % this.initWebSocket();5_  g* % this.makeDraggable();5_  g*  }5_g* 5_ g*  render() {5_g* - this.shadowRoot.innerHTML = `5_g*  5_=?>g0 % 5_EGFg0 =
5_FHGg0 .
5_GIHg0 A 5_HJIg1 P 5_IKJg1 
5_JLKg1  `;5_KMLg1 5_LNMg1 C this.chat = this.shadowRoot.getElementById('chat');5_MONg1 E this.input = this.shadowRoot.getElementById('input');5_NPOg1 I this.sendButton = this.shadowRoot.getElementById('send');5_OQPg1 K this.themeSelect = this.shadowRoot.getElementById('theme');5_PRQg1 5_QSRg1 T this.sendButton.addEventListener('click', () => this.sendMessage());5_RTSg1 V this.themeSelect.addEventListener('change', () => this.changeTheme());5_SUT g2  }5_TVUg2 5_UWV g2  initWebSocket() {5_VXWg2 B this.ws = new WebSocket('ws://localhost:8080/ws');5_WYXg2 5_XZYg2 0 this.ws.onmessage = (event) => {5_Y[Zg2 B const message = document.createElement('div');5_Z\[g2 5 message.textContent = event.data;5_[]\g2 3 this.chat.appendChild(message);5_\^]g2 P this.chat.scrollTop = this.chat.scrollHeight; // Auto-scroll5_]_^g2  };5_^`_ g2  }5__a`g3 5_`ba g3  sendMessage() {5_acbg3 1 const message = this.input.value;5_bdcg3  if (message) {5_cedg3 * this.ws.send(message);5_dfeg3 F const userMessage = document.createElement('div');5_egfg3 @ userMessage.textContent = `You: ${message}`;5_fhgg3 7 this.chat.appendChild(userMessage);5_gihg3 P this.chat.scrollTop = this.chat.scrollHeight; // Auto-scroll5_hjig3 * this.input.value = '';5_ikjg3  }5_jlk g3  }5_kmlg3 5_lnm g4  changeTheme() {5_mong4 = this.chat.className = this.themeSelect.value;5_npo g4  }5_oqpg4 5_prq g4  makeDraggable() {5_qsrg4 H const header = this.shadowRoot.getElementById('header');5_rtsg4 ' let isDragging = false;5_sutg4 , let offset = { x: 0, y: 0 };5_tvug4 5_uwvg5 = header.addEventListener('mousedown', (e) => {5_vxwg5 & isDragging = true;5_wyxg5 M offset.x = e.clientX - this.getBoundingClientRect().left;5_xzyg5 L offset.y = e.clientY - this.getBoundingClientRect().top;5_y{zg5 5 header.style.cursor = 'grabbing';5_z|{g5  });5_{}|g5 5_|~}g5 < document.addEventListener('mouseup', () => {5_}~g5 ' isDragging = false;5_~g5 1 header.style.cursor = 'move';5_g6  });5_g6 5_g6 ? document.addEventListener('mousemove', (e) => {5_g6 % if (isDragging) {5_g6 9 this.style.position = 'absolute';5_g6 F this.style.left = `${e.clientX - offset.x}px`;5_g6 E this.style.top = `${e.clientY - offset.y}px`;5_g6  }5_g6  });5_ g6  }5_g7  }5_g7 5_g8 3 customElements.define('chat-app', ChatApp);5_g:  5_ gC 5_ gD  5_ g9 + 5_ +gR 6 asfasfsaasf5_gT 5_ g-  5_ g 3 5_ g D 5_g& - You are the spoke person of Molodetz.5_g'  5_!g.! Talk only about software.5_g5  5_g6   5_gL 5_gg  5_gh  5_gl5_gn 5_gܜ * {5_gܟ chat {5_gܡ padding: 10px;5_gܡ }5_gܢ  5_ g #chat {5_g background-color: 000;5_g  background-color: 000;5_g #chat.theme-light {5_ g #chat-app {5_g  background-color: #000;5